{% extends 'layout.html' %}

{% block css %}
    {% load staticfiles %}

    <link rel="stylesheet" href="/static/css/input-autocomplete.css" />
    <style>
        .dropservice {
            margin-left: 20px;
            margin-top: 20px;
        }

    </style>
{% endblock %}

{% block menus %}
    {{ menu_string | safe }}
{% endblock %}

{% block content %}

        <form method="get" onsubmit="return false">
            <div class="dropservice">
                ID： <input id="auto" type="text" name="name" class="input-all" autocomplete="off"/>
                <div id="submitForm" style="margin-left: 33px" class="btn-all">删除</div>
            </div>
        </form>

{% endblock %}

{% block js %}
	<script src="/static/js/input-autocomplete.js" type="text/javascript"></script>
	<script src="/static/js/data.js" type="text/javascript"></script>
	<script src="/static/js/demo.js" type="text/javascript"></script>
    <script>
        $(function () {
            $('#menu_student').addClass('active');
            $('#menu_student').next().removeClass('hide');

        })
        $('#submitForm').click(function () {
        var name=$('#auto').val()
        if(name.length == 0){
            alert('不能为空')
            return
        }
        console.log(name)
        $.ajax({
            url: '/del_consul/',
            type: 'post',
            dataType: 'json',
            data: {name:name},
            success: function (rep) {
                alert(rep.msg)
            }
            })
        })
    </script>
{% endblock %}